#ifndef DIALOG_H
#define DIALOG_H

#include <QDialog>
#include <QTcpSocket>
#include <QUdpSocket>
#include <QDebug>
#include <string.h>
#include <QByteArray>
#include <QTimer>

#include <QCoreApplication>
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <QString>
#include <QJsonParseError>

#include <QFile>
#include <QMessageBox>


namespace Ui {
class Dialog;
}

class Dialog : public QDialog
{
    Q_OBJECT

public:
    explicit Dialog(QWidget *parent = 0);
    ~Dialog();

private:
    Ui::Dialog *ui;
    QTcpSocket *socket;//心跳检测
    QTcpSocket *socket_json;//下发点表
    QUdpSocket *udpsocket;
    QByteArray datagram;//存放数据
    quint16 senderPort;//存放端口号
    QHostAddress sender;//存放ip
    QTimer *timer;//定时器对象
    QString inJSON(QByteArray); //序列化
    void putJson();//下发JSON文件
    QString readPath;//读取路径

private slots:
    void btnselectSlot();
    void btnconnectSlot();
    void readReadySlot();
    void connectSlot();
    void TCPreadReadySlot();
    void timeOutSlot();

    void fileconnectSlot();


};

#endif // DIALOG_H
